import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import React, { PureComponent } from 'react';
import { Icon, Input } from 'antd';

var ParentDirInput = /*#__PURE__*/function (_PureComponent) {
  _inherits(ParentDirInput, _PureComponent);

  var _super = _createSuper(ParentDirInput);

  function ParentDirInput() {
    _classCallCheck(this, ParentDirInput);

    return _super.apply(this, arguments);
  }

  _createClass(ParentDirInput, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          textValue = _this$props.textValue,
          _this$props$disabled = _this$props.disabled,
          disabled = _this$props$disabled === void 0 ? false : _this$props$disabled,
          _this$props$onClick = _this$props.onClick,
          onClick = _this$props$onClick === void 0 ? function (e) {
        return e;
      } : _this$props$onClick;
      return /*#__PURE__*/React.createElement(Input, {
        readOnly: true,
        disabled: disabled,
        value: textValue,
        onClick: onClick,
        style: {
          verticalAlign: 'middle',
          position: 'relative',
          top: -1
        },
        addonAfter: /*#__PURE__*/React.createElement(Icon, {
          type: "search",
          onClick: !disabled && onClick,
          style: {
            cursor: disabled ? 'not-allowed' : 'pointer'
          }
        })
      });
    }
  }]);

  return ParentDirInput;
}(PureComponent);

export { ParentDirInput as default };